﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MMS.UI.Helper
{
    /// <summary>
    /// 通过EnumHelper管理自定义枚举数据
    /// 自定义枚举数据 ： 主要用来保存 数据库中没有保存 但 实际开发中使用的 枚举数据
    /// 如 权限表的请求方式：1-GET 2-POST 3-BOTH
    /// </summary>
    public static class EnumHelper
    {
        /// <summary>
        ///权限的 请求方式
        /// </summary>
        public static class FormMethod
        {
            public static int GET = 1;
            public static int POST = 2;
            public static int BOTH = 3;

            static List<System.Web.Mvc.SelectListItem> _ddlData = null;
            /// <summary>
            /// 下拉框数据
            /// </summary>
            public static List<System.Web.Mvc.SelectListItem> DDLData
            {
                get
                {
                    if (_ddlData == null)
                        _ddlData = new List<System.Web.Mvc.SelectListItem>() { 
                       new System.Web.Mvc.SelectListItem(){Value="1",Text="GET" },
                       new System.Web.Mvc.SelectListItem(){Value="2",Text="POST" },
                       new System.Web.Mvc.SelectListItem(){Value="3",Text="BOTH" }
                    };
                    return _ddlData;
                }
            }
        }

        /// <summary>
        /// 权限的 类型
        /// </summary>
        public static class OperationType
        {
            public static int MENU = 1;
            public static int BUTTON = 2;
            public static int AJAX = 3;

            static List<System.Web.Mvc.SelectListItem> _ddlData = null;
            /// <summary>
            /// 下拉框数据
            /// </summary>
            public static List<System.Web.Mvc.SelectListItem> DDLData
            {
                get
                {
                    if (_ddlData == null)
                        _ddlData = new List<System.Web.Mvc.SelectListItem>() { 
                       new System.Web.Mvc.SelectListItem(){Value="1",Text="MENU" },
                       new System.Web.Mvc.SelectListItem(){Value="2",Text="BUTTON" },
                       new System.Web.Mvc.SelectListItem(){Value="3",Text="AJAX" }
                    };
                    return _ddlData;
                }
            }
        }

        /// <summary>
        /// 年、季度、月、周、日
        /// </summary>
        public static class DatePart
        {
            public static string Year = "按年";
            public static string Quarter = "按季度";
            public static string Month = "按月";
            public static string Week = "按周";
            public static string Day = "按日";
            public static string Hour = "按日";
            static List<System.Web.Mvc.SelectListItem> _ddlData = null;
            /// <summary>
            /// 下拉框数据
            /// </summary>
            public static List<System.Web.Mvc.SelectListItem> DDLData
            {
                get
                {
                    if (_ddlData == null)
                        _ddlData = new List<System.Web.Mvc.SelectListItem>() { 
                       new System.Web.Mvc.SelectListItem(){Value="year",Text="按年" },
                       new System.Web.Mvc.SelectListItem(){Value="quarter",Text="按季度" },
                       new System.Web.Mvc.SelectListItem(){Value="month",Text="按月" },
                       new System.Web.Mvc.SelectListItem(){Value="week",Text="按周" },
                       new System.Web.Mvc.SelectListItem(){Value="day",Text="按日" },
                       new System.Web.Mvc.SelectListItem(){Value="hour",Text="按小时" }
                    };
                    return _ddlData;
                }
            }
        }

        /// <summary>
        /// 年、季度、月、周、日
        /// </summary>
        public static class Category
        {
            public static string Gender = "按性别";
            public static string Age = "按年龄";
            public static string Consumption = "按消费额度";
          
            static List<System.Web.Mvc.SelectListItem> _ddlData = null;
            /// <summary>
            /// 下拉框数据
            /// </summary>
            public static List<System.Web.Mvc.SelectListItem> DDLData
            {
                get
                {
                    if (_ddlData == null)
                        _ddlData = new List<System.Web.Mvc.SelectListItem>() { 
                     new System.Web.Mvc.SelectListItem(){Value="按消费额度",Text="按消费额度" },
                       new System.Web.Mvc.SelectListItem(){Value="按性别",Text="按性别" },
                       new System.Web.Mvc.SelectListItem(){Value="按年龄",Text="按年龄" }                       
                    };
                    return _ddlData;
                }
            }
        }

    }
}